package com.aldobucchi.x.flash.display
{
	
	
	import flash.display.DisplayObjectContainer;
	
	import mx.containers.HBox;
	import mx.controls.Label;
	
	import com.aldobucchi.utils.AbstractTest;



	public class DisplayObjectContainerUtilTest extends AbstractTest
	{
		
		

		public function test_syncChildrenToArray( ):void
		{
		
			var p1:DisplayObjectContainer = new HBox( );
			var c1:* = new Label( );
			var c2:* = new Label( );
			var c3:* = new Label( );
			
			var c123:Array = [ c1, c2, c3 ];
			var c321:Array = [ c3, c2, c1 ];
			var c12:Array = [ c1, c2 ];
			var c31:Array = [ c3, c1 ];
			
			
				assertContainersEqual( p1, [] );
		
			
			DisplayObjectContainerUtil.syncChildrenToArray( p1, c123 );
			
				assertContainersEqual( p1, c123 );


			DisplayObjectContainerUtil.syncChildrenToArray( p1, c321 );
			
				assertContainersEqual( p1, c321 );			
			

			DisplayObjectContainerUtil.syncChildrenToArray( p1, c12 );
			
				assertContainersEqual( p1, c12 );			
			

			DisplayObjectContainerUtil.syncChildrenToArray( p1, c31 );
			
				assertContainersEqual( p1, c31 );

						
					
		
		}
		
		
		
		
		
		
	}
	
}